<div class="section">
    <div class="section-title">Welcome - {{if auth.is_logged_in():}}You are Logged In{{else:}}Please Login{{pass}}</div>
    <div class="section-content">
        <div><a class="smallb" href="{{=URL(r=request, c='default', f='index')}}">HOME</a></div>
        {{if auth.is_logged_in():}}
            <div><a class="smallb" href="{{=URL(r=request, c='default', f='preferences')}}">User Preferences</a></div>
            <!-- <div><a class="smallb" href="{{=URL(r=request, c='default', f='user', args=['logout'])}}">Logout {{=auth.user.email}}</a></div> //-->
            <div><a class="smallb" href="{{=URL(r=request, c='default', f='logout')}}">Logout {{=auth.user.email}}</a></div>
        {{else:}}
            <!-- <div><a class="smallb" href="{{=URL(r=request, c='default', f='user', args=['login'])}}">Login</a></div> //-->
            <div><a class="smallb" href="{{=URL(r=request, c='default', f='login')}}">Login</a></div>
            <div><a class="smallb" href="{{=URL(r=request, c='default', f='user', args=['register'])}}">Register</a></div>
        {{pass}}
        <div><a class="small" href="{{=URL(r=request, c='default', f='contact')}}">Contact Administrator</a></div>
    </div>
</div>

{{if auth.has_membership(forum_memberships['FORUM_ADMINISTRATOR']):}}
    <div class="section">
        <div class="section-title">Administration</div>
        <div class="section-content">
            <div><a class="small" href="{{=URL(r=request, c='fadmin', f='index')}}">System Administration</a></div>
            <div><a class="small" href="#">Administrative Messages</a></div>
        </div>
    </div>
{{pass}}

<div class="section">
    <div class="section-title">System Announcements</div>
    <div class="section-content">
        {{for sys_topic in forumhelper.get_system_announcements():}}
            {{if sys_topic.has_key('error'):}}
                <div><i>No System Announcements Available</i></div>
            {{else:}}
                <div>
                    {{=sys_topic.get('modifying_date', request.now).strftime('%d/%m/%y')}} -
                    <a href="{{=URL(r=request, c='default', f='view_topic', args=[sys_topic.id])}}"
                    title="{{=sys_topic.get('title', '').replace('"', '')}}"
                    class="small">{{=sys_topic.get('title', '')[:30]}} ..</a>
                </div>
            {{pass}}
        {{pass}}
    </div>
</div>

<div class="section">
    <div class="section-title">Latest Posts</div>
    <div class="section-content">
        {{for latest_topic in forumhelper.get_latest_topics():}}
            {{if latest_topic.has_key('error'):}}
                <div><i>No Latest Postings Available</i></div>
            {{else:}}
                <div>
                    {{=latest_topic.get('modifying_date', request.now).strftime('%d/%m/%y')}} -
                    <a href="{{=URL(r=request, c='default', f='view_topic', args=[latest_topic.get('id', '')])}}"
                    title="{{=latest_topic.get('title', '').replace('"', '')}}"
                    class="small-link-sidenav">{{=latest_topic.get('title', '')[:30]}} ..</a>
                </div>
            {{pass}}
        {{pass}}
    </div>
</div>
